﻿﻿using System;
using System.Collections.Generic;
using System.Text;
namespace WebApplication1.DDD.Models.Entity.Common
{
    public class users:NFinal.Struct
    {
		/// <summary>
        /// 用户表ID
        /// </summary>
		public System.Int64 id;
		/// <summary>
        /// 名称
        /// </summary>
		public System.String name;
		/// <summary>
        /// 密码
        /// </summary>
		public System.String pwd;
		#region 从get列表初始化实体类
		public static bool TryParse(NFinal.NameValueCollection get,out users par)
		{
			par=new users();
			try
			{
						System.Int64.TryParse(get["id"],out par.id);
						par.name=get["name"];
						par.pwd=get["pwd"];
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public override void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"id\":");
					tw.Write(id.ToString());
					tw.Write(",");
					tw.Write("\"name\":");
					tw.Write("\"");
					tw.Write(name==null?"null":name);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"pwd\":");
					tw.Write("\"");
					tw.Write(pwd==null?"null":pwd);
					tw.Write("\"");
			tw.Write("}");
		}
		#endregion
    }
}
